package com.example.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@TableName("reserve")
@Data
public class Reserve {
    public static final String ID = "id";
    public static final String NAME = "name";
    public static final String USER_NAME = "user_name";
    public static final String TEACHER_NAME = "teacher_name";
    public static final String TIME = "time";
    public static final String USE_TIME = "use_time";
    public static final String RESERVE_STATUS = "reserve_status";
    public static final String USE_STATUS = "use_status";
    public static final String ROOM_ID = "room_id";
    public static final String USER_ID = "user_id";
    public static final String START_TIME = "startTime";
    public static final String END_TIME = "endTime";
    public static final String TOTAL_PRICE = "total_price";

    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    @TableField(NAME)
    private String name;

    @TableField(USER_NAME)
    private String userName;

    @TableField(TEACHER_NAME)
    private String teacherName;

    @TableField(TIME)
    private String time;

    @TableField(USE_TIME)
    private String useTime;

    @TableField(RESERVE_STATUS)
    private Integer reserveStatus;

    @TableField(value = USE_STATUS,updateStrategy = FieldStrategy.DEFAULT)
    private Integer useStatus;

    @TableField(value = ROOM_ID,updateStrategy = FieldStrategy.DEFAULT)
    private Integer roomId;

    @TableField(value = USER_ID,updateStrategy = FieldStrategy.DEFAULT)
    private Integer userId;

    @TableField(START_TIME)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime startTime;

    @TableField(END_TIME)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime endTime;

    @TableField(TOTAL_PRICE)
    private Double totalPrice;

    @TableField(exist = false,updateStrategy = FieldStrategy.DEFAULT)
    private Integer payStatus;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField(exist = false,updateStrategy = FieldStrategy.DEFAULT)
    private Long orderId;

    @TableField(exist = false,updateStrategy = FieldStrategy.DEFAULT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime paymentDeadline;

}